package org.millioncall.yueyoga.admin.dao;

import java.util.List;
import java.util.Map;

import org.millioncall.openplatform.common.PaginatedList;
import org.millioncall.yueyoga.admin.model.GroupUserModel;
import org.millioncall.yueyoga.admin.model.Hall;
import org.millioncall.yueyoga.admin.model.User;
import org.millioncall.yueyoga.admin.model.UserHallModel;
import org.millioncall.yueyoga.admin.model.UserHallRole;

public interface UserDAO {

	public List<User> findTaskUser();

	// 保存用户
	public int save(Map<String, Object> map);

	// 保存用户
	public int saveUserGroup(Map<String, Object> map);

	// 更新用户
	public int update(Map<String, Object> map);
	//更新用户组
	public int updateUserGroups(Map<String, Object> map);

	// 删除用户
	public int delete(String id);

	public int deleteByIds(String[] ids);

	public User findById(String id);
	
	public int deleteUserById(List<String> Ids);

	public User findByUsername(String username);

	public List<User> findByProperty(String key, String val);

	public List<User> findAllUsers(Map<String, Object> map);

	// 条件分页查询
	public PaginatedList<User> findUsersInPage(int start, int limit,
			Map<String, Object> map);

	public int updateUser(Map<String, Object> map);

	public PaginatedList<User> findByGroupInPage(Integer start, Integer limit,
			String name);

	public List<User> findByGroup(Integer start, Integer limit, String name);

	public int deleteByGroup(String name);

	public List<User> findAllAssignedTo(String name);

	/**
	 * 查询负责人
	 * 
	 * @param map
	 * @return
	 */
	public List<GroupUserModel> findGroupUserByGroupId(Map<String, Object> map);
	
	public int updatePassword(Map<String, Object> map);
	
	/***查询当前登录用户的所在用户组的分馆编号 */
	public List<UserHallModel> findUserGroupHall(Map<String, Object> map);
	
	/***当前用户所在会馆的名称*/
	public Hall findUserByHallName(String hallcode);
	
	/***判断会员所在组是否指定资源*/
	public List<UserHallRole> findRoleId(String userId);
}
